Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: using smp_processor_id() in preemptible [00000000] code: zpool/841 #7609

Closed
softminus opened this issue Jun 6, 2018 · 3 comments
Closed

Comments

@softminus
Copy link

System information

Type Version/Name
Distribution Name Arch Linux
Distribution Version latest rolling
Linux Kernel 4.17.0-1
Architecture x86_64
ZFS Version latest git (0.7.0-1420_g62841115b)
SPL Version latest git (0.7.0-1420_g62841115b)

Describe the problem you're observing

Upon "zpool import", I get repeated "BUG: using smp_processor_id() in preemptible [00000000] code: zpool/841 caller is aggsum_add+0x29/0x180 [zfs]" messages in the kernel log (similar messages appear, with "code: zpool/841" replaced by "code: txg_sync/980, code: z_rd_int_0/846"). This looks a bit like issue #6232, it's a similar error message.

Describe how to reproduce the problem

git clone the zfs repository
./autogen && ./configure --prefix=/opt --sysconfdir=/etc --sbindir=/opt/sbin --libdir=/opt/lib --datadir=/opt/share --includedir=/opt/include --with-udevdir=/lib/udev --libexecdir=/opt/lib/zfs --with-config=all --with-linux=$KERNDIR/build/ --with-linux-obj=$KERNDIR/build/ && make && make install

I then update the kernel mkinitcpio and module dependencies, reboot, and run "zpool import mypool", and it immediately triggers the messages.

Include any warning/errors/backtraces from the system logs

Jun 06 14:45:56 NG sudo[840]:      xxx : TTY=pts/0 ; PWD=/home/xxx ; USER=root ; COMMAND=/opt/sbin/zpool import mypool
Jun 06 14:45:56 NG sudo[840]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 06 14:45:56 NG kernel: BUG: using smp_processor_id() in preemptible [00000000] code: zpool/841
Jun 06 14:45:56 NG kernel: caller is aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel: CPU: 0 PID: 841 Comm: zpool Tainted: P           O      4.17.0-1-ARCH #1
Jun 06 14:45:56 NG kernel: Hardware name: LENOVO 20BXCTO1WW/20BXCTO1WW, BIOS JBET61WW (1.25 ) 07/13/2016
Jun 06 14:45:56 NG kernel: Call Trace:
Jun 06 14:45:56 NG kernel:  dump_stack+0x5c/0x80
Jun 06 14:45:56 NG kernel:  check_preemption_disabled.cold.0+0x46/0x51
Jun 06 14:45:56 NG kernel:  aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel:  arc_space_consume+0x2c/0xb0 [zfs]
Jun 06 14:45:56 NG kernel:  hdr_full_cons+0xcb/0xd0 [zfs]
Jun 06 14:45:56 NG kernel:  spl_kmem_cache_alloc+0xa0/0x750 [spl]
Jun 06 14:45:56 NG kernel:  ? update_curr+0x70/0x1f0
Jun 06 14:45:56 NG kernel:  arc_hdr_alloc+0x103/0x160 [zfs]
Jun 06 14:45:56 NG kernel:  arc_read+0x4d1/0xf70 [zfs]
Jun 06 14:45:56 NG kernel:  ? arc_prune_task+0x30/0x30 [zfs]
Jun 06 14:45:56 NG kernel:  dmu_objset_open_impl+0x10a/0x9e0 [zfs]
Jun 06 14:45:56 NG kernel:  dsl_pool_init+0x31/0x60 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load_impl+0xf2b/0x23f0 [zfs]
Jun 06 14:45:56 NG kernel:  ? _raw_spin_lock+0x13/0x40
Jun 06 14:45:56 NG kernel:  ? __dprintf+0xc0/0x120 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load+0x59/0x100 [zfs]
Jun 06 14:45:56 NG kernel:  spa_tryimport+0x116/0x550 [zfs]
Jun 06 14:45:56 NG kernel:  zfs_ioc_pool_tryimport+0x61/0xc0 [zfs]
Jun 06 14:45:56 NG kernel:  zfsdev_ioctl+0x550/0x650 [zfs]
Jun 06 14:45:56 NG kernel:  do_vfs_ioctl+0xa4/0x610
Jun 06 14:45:56 NG kernel:  ? _crng_backtrack_protect+0x32/0x60
Jun 06 14:45:56 NG kernel:  ? memzero_explicit+0xa/0x10
Jun 06 14:45:56 NG kernel:  ? urandom_read+0x120/0x270
Jun 06 14:45:56 NG kernel:  ksys_ioctl+0x60/0x90
Jun 06 14:45:56 NG kernel:  __x64_sys_ioctl+0x16/0x20
Jun 06 14:45:56 NG kernel:  do_syscall_64+0x5b/0x170
Jun 06 14:45:56 NG kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jun 06 14:45:56 NG kernel: RIP: 0033:0x7fd9a5ad3667
Jun 06 14:45:56 NG kernel: RSP: 002b:00007ffc36b31008 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Jun 06 14:45:56 NG kernel: RAX: ffffffffffffffda RBX: 00007ffc36b31020 RCX: 00007fd9a5ad3667
Jun 06 14:45:56 NG kernel: RDX: 00007ffc36b31020 RSI: 0000000000005a06 RDI: 0000000000000003
Jun 06 14:45:56 NG kernel: RBP: 0000562663ed3430 R08: 0000562663ee3bb0 R09: 0000000000000001
Jun 06 14:45:56 NG kernel: R10: 0000562663ed2010 R11: 0000000000000246 R12: 0000562663ed9df0
Jun 06 14:45:56 NG kernel: R13: 0000562663ed84f8 R14: 00007ffc36b34690 R15: 00007ffc36b346d8
Jun 06 14:45:56 NG kernel: BUG: using smp_processor_id() in preemptible [00000000] code: zpool/841
Jun 06 14:45:56 NG kernel: caller is aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel: CPU: 0 PID: 841 Comm: zpool Tainted: P           O      4.17.0-1-ARCH #1
Jun 06 14:45:56 NG kernel: Hardware name: LENOVO 20BXCTO1WW/20BXCTO1WW, BIOS JBET61WW (1.25 ) 07/13/2016
Jun 06 14:45:56 NG kernel: Call Trace:
Jun 06 14:45:56 NG kernel:  dump_stack+0x5c/0x80
Jun 06 14:45:56 NG kernel:  check_preemption_disabled.cold.0+0x46/0x51
Jun 06 14:45:56 NG kernel:  aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel:  arc_space_consume+0x3b/0xb0 [zfs]
Jun 06 14:45:56 NG kernel:  hdr_full_cons+0xcb/0xd0 [zfs]
Jun 06 14:45:56 NG kernel:  spl_kmem_cache_alloc+0xa0/0x750 [spl]
Jun 06 14:45:56 NG kernel:  ? update_curr+0x70/0x1f0
Jun 06 14:45:56 NG kernel:  arc_hdr_alloc+0x103/0x160 [zfs]
Jun 06 14:45:56 NG kernel:  arc_read+0x4d1/0xf70 [zfs]
Jun 06 14:45:56 NG kernel:  ? arc_prune_task+0x30/0x30 [zfs]
Jun 06 14:45:56 NG kernel:  dmu_objset_open_impl+0x10a/0x9e0 [zfs]
Jun 06 14:45:56 NG kernel:  dsl_pool_init+0x31/0x60 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load_impl+0xf2b/0x23f0 [zfs]
Jun 06 14:45:56 NG kernel:  ? _raw_spin_lock+0x13/0x40
Jun 06 14:45:56 NG kernel:  ? __dprintf+0xc0/0x120 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load+0x59/0x100 [zfs]
Jun 06 14:45:56 NG kernel:  spa_tryimport+0x116/0x550 [zfs]
Jun 06 14:45:56 NG kernel:  zfs_ioc_pool_tryimport+0x61/0xc0 [zfs]
Jun 06 14:45:56 NG kernel:  zfsdev_ioctl+0x550/0x650 [zfs]
Jun 06 14:45:56 NG kernel:  do_vfs_ioctl+0xa4/0x610
Jun 06 14:45:56 NG kernel:  ? _crng_backtrack_protect+0x32/0x60
Jun 06 14:45:56 NG kernel:  ? memzero_explicit+0xa/0x10
Jun 06 14:45:56 NG kernel:  ? urandom_read+0x120/0x270
Jun 06 14:45:56 NG kernel:  ksys_ioctl+0x60/0x90
Jun 06 14:45:56 NG kernel:  __x64_sys_ioctl+0x16/0x20
Jun 06 14:45:56 NG kernel:  do_syscall_64+0x5b/0x170
Jun 06 14:45:56 NG kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jun 06 14:45:56 NG kernel: RIP: 0033:0x7fd9a5ad3667
Jun 06 14:45:56 NG kernel: RSP: 002b:00007ffc36b31008 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Jun 06 14:45:56 NG kernel: RAX: ffffffffffffffda RBX: 00007ffc36b31020 RCX: 00007fd9a5ad3667
Jun 06 14:45:56 NG kernel: RDX: 00007ffc36b31020 RSI: 0000000000005a06 RDI: 0000000000000003
Jun 06 14:45:56 NG kernel: RBP: 0000562663ed3430 R08: 0000562663ee3bb0 R09: 0000000000000001
Jun 06 14:45:56 NG kernel: R10: 0000562663ed2010 R11: 0000000000000246 R12: 0000562663ed9df0
Jun 06 14:45:56 NG kernel: R13: 0000562663ed84f8 R14: 00007ffc36b34690 R15: 00007ffc36b346d8
Jun 06 14:45:56 NG kernel: BUG: using smp_processor_id() in preemptible [00000000] code: zpool/841
Jun 06 14:45:56 NG kernel: caller is aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel: CPU: 0 PID: 841 Comm: zpool Tainted: P           O      4.17.0-1-ARCH #1
Jun 06 14:45:56 NG kernel: Hardware name: LENOVO 20BXCTO1WW/20BXCTO1WW, BIOS JBET61WW (1.25 ) 07/13/2016
Jun 06 14:45:56 NG kernel: Call Trace:
Jun 06 14:45:56 NG kernel:  dump_stack+0x5c/0x80
Jun 06 14:45:56 NG kernel:  check_preemption_disabled.cold.0+0x46/0x51
Jun 06 14:45:56 NG kernel:  aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel:  hdr_full_cons+0xcb/0xd0 [zfs]
Jun 06 14:45:56 NG kernel:  spl_kmem_cache_alloc+0xa0/0x750 [spl]
Jun 06 14:45:56 NG kernel:  ? update_curr+0x70/0x1f0
Jun 06 14:45:56 NG kernel:  arc_hdr_alloc+0x103/0x160 [zfs]
Jun 06 14:45:56 NG kernel:  arc_read+0x4d1/0xf70 [zfs]
Jun 06 14:45:56 NG kernel:  ? arc_prune_task+0x30/0x30 [zfs]
Jun 06 14:45:56 NG kernel:  dmu_objset_open_impl+0x10a/0x9e0 [zfs]
Jun 06 14:45:56 NG kernel:  dsl_pool_init+0x31/0x60 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load_impl+0xf2b/0x23f0 [zfs]
Jun 06 14:45:56 NG kernel:  ? _raw_spin_lock+0x13/0x40
Jun 06 14:45:56 NG kernel:  ? __dprintf+0xc0/0x120 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load+0x59/0x100 [zfs]
Jun 06 14:45:56 NG kernel:  spa_tryimport+0x116/0x550 [zfs]
Jun 06 14:45:56 NG kernel:  zfs_ioc_pool_tryimport+0x61/0xc0 [zfs]
Jun 06 14:45:56 NG kernel:  zfsdev_ioctl+0x550/0x650 [zfs]
Jun 06 14:45:56 NG kernel:  do_vfs_ioctl+0xa4/0x610
Jun 06 14:45:56 NG kernel:  ? _crng_backtrack_protect+0x32/0x60
Jun 06 14:45:56 NG kernel:  ? memzero_explicit+0xa/0x10
Jun 06 14:45:56 NG kernel:  ? urandom_read+0x120/0x270
Jun 06 14:45:56 NG kernel:  ksys_ioctl+0x60/0x90
Jun 06 14:45:56 NG kernel:  __x64_sys_ioctl+0x16/0x20
Jun 06 14:45:56 NG kernel:  do_syscall_64+0x5b/0x170
Jun 06 14:45:56 NG kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jun 06 14:45:56 NG kernel: RIP: 0033:0x7fd9a5ad3667
Jun 06 14:45:56 NG kernel: RSP: 002b:00007ffc36b31008 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Jun 06 14:45:56 NG kernel: RAX: ffffffffffffffda RBX: 00007ffc36b31020 RCX: 00007fd9a5ad3667
Jun 06 14:45:56 NG kernel: RDX: 00007ffc36b31020 RSI: 0000000000005a06 RDI: 0000000000000003
Jun 06 14:45:56 NG kernel: RBP: 0000562663ed3430 R08: 0000562663ee3bb0 R09: 0000000000000001
Jun 06 14:45:56 NG kernel: R10: 0000562663ed2010 R11: 0000000000000246 R12: 0000562663ed9df0
Jun 06 14:45:56 NG kernel: R13: 0000562663ed84f8 R14: 00007ffc36b34690 R15: 00007ffc36b346d8
Jun 06 14:45:56 NG kernel: BUG: using smp_processor_id() in preemptible [00000000] code: zpool/841
Jun 06 14:45:56 NG kernel: caller is aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel: CPU: 0 PID: 841 Comm: zpool Tainted: P           O      4.17.0-1-ARCH #1
Jun 06 14:45:56 NG kernel: Hardware name: LENOVO 20BXCTO1WW/20BXCTO1WW, BIOS JBET61WW (1.25 ) 07/13/2016
Jun 06 14:45:56 NG kernel: Call Trace:
Jun 06 14:45:56 NG kernel:  dump_stack+0x5c/0x80
Jun 06 14:45:56 NG kernel:  check_preemption_disabled.cold.0+0x46/0x51
Jun 06 14:45:56 NG kernel:  aggsum_add+0x29/0x180 [zfs]
Jun 06 14:45:56 NG kernel:  ? wait_woken+0x80/0x80
Jun 06 14:45:56 NG kernel:  arc_space_consume+0x8f/0xb0 [zfs]
Jun 06 14:45:56 NG kernel:  arc_get_data_impl.isra.17+0x1a5/0x350 [zfs]
Jun 06 14:45:56 NG kernel:  arc_get_data_abd.isra.18+0x28/0x50 [zfs]
Jun 06 14:45:56 NG kernel:  arc_hdr_alloc_abd+0x4e/0xa0 [zfs]
Jun 06 14:45:56 NG kernel:  arc_hdr_alloc+0xd8/0x160 [zfs]
Jun 06 14:45:56 NG kernel:  arc_read+0x4d1/0xf70 [zfs]
Jun 06 14:45:56 NG kernel:  ? arc_prune_task+0x30/0x30 [zfs]
Jun 06 14:45:56 NG kernel:  dmu_objset_open_impl+0x10a/0x9e0 [zfs]
Jun 06 14:45:56 NG kernel:  dsl_pool_init+0x31/0x60 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load_impl+0xf2b/0x23f0 [zfs]
Jun 06 14:45:56 NG kernel:  ? _raw_spin_lock+0x13/0x40
Jun 06 14:45:56 NG kernel:  ? __dprintf+0xc0/0x120 [zfs]
Jun 06 14:45:56 NG kernel:  spa_load+0x59/0x100 [zfs]
Jun 06 14:45:56 NG kernel:  spa_tryimport+0x116/0x550 [zfs]
Jun 06 14:45:56 NG kernel:  zfs_ioc_pool_tryimport+0x61/0xc0 [zfs]
Jun 06 14:45:56 NG kernel:  zfsdev_ioctl+0x550/0x650 [zfs]
Jun 06 14:45:56 NG kernel:  do_vfs_ioctl+0xa4/0x610
Jun 06 14:45:56 NG kernel:  ? _crng_backtrack_protect+0x32/0x60
Jun 06 14:45:56 NG kernel:  ? memzero_explicit+0xa/0x10
Jun 06 14:45:56 NG kernel:  ? urandom_read+0x120/0x270
Jun 06 14:45:56 NG kernel:  ksys_ioctl+0x60/0x90
Jun 06 14:45:56 NG kernel:  __x64_sys_ioctl+0x16/0x20
Jun 06 14:45:56 NG kernel:  do_syscall_64+0x5b/0x170
Jun 06 14:45:56 NG kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
Jun 06 14:45:56 NG kernel: RIP: 0033:0x7fd9a5ad3667
Jun 06 14:45:56 NG kernel: RSP: 002b:00007ffc36b31008 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Jun 06 14:45:56 NG kernel: RAX: ffffffffffffffda RBX: 00007ffc36b31020 RCX: 00007fd9a5ad3667
Jun 06 14:45:56 NG kernel: RDX: 00007ffc36b31020 RSI: 0000000000005a06 RDI: 0000000000000003
Jun 06 14:45:56 NG kernel: RBP: 0000562663ed3430 R08: 0000562663ee3bb0 R09: 0000000000000001
Jun 06 14:45:56 NG kernel: R10: 0000562663ed2010 R11: 0000000000000246 R12: 0000562663ed9df0
Jun 06 14:45:56 NG kernel: R13: 0000562663ed84f8 R14: 00007ffc36b34690 R15: 00007ffc36b346d8
``
@prometheanfire
Copy link
Contributor

I've hit this as well in master. Here is my kernel log https://gist.github.com/prometheanfire/2dd6edd5981908da24ec417f74dd6bac

@UralZima
Copy link

UralZima commented Jun 7, 2018

Have the same issue. Can't use newly compiled kernel, it always compiles on latest master on gentoo

behlendorf added a commit to behlendorf/zfs that referenced this issue Jun 7, 2018
In the new aggsum counters the CPU_SEQID macro should be surrounded by
kpreempt_disable)() and kpreempt_enable() calls to prevent a Linux
kernel BUG warning.  The addsum_add() function use the cpuid to
minimize lock contention when selecting a bucket, after selection
the bucket is protected by a mutex and it is safe to reschedule the
process to a different processor at any time.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#7609
@behlendorf
Copy link
Contributor

I've opened #7610 with the fix. If someone hitting this issue could verify that fix we can speed up getting it merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants